package com.jeesite.modules.pt.entity;

import javax.validation.constraints.Size;
import java.util.Date;
import java.util.Map;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 消息Entity
 * @author 李寒冰
 * @version 2025-04-23
 */
@Table(name="pt_push", alias="a", label="消息信息", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="create_time", attrName="createTime", label="create_time", isUpdateForce=true),
		@Column(name="content", attrName="content", label="内容"),
		@Column(name="url", attrName="url", label="跳转地址"),
		@Column(name="is_read", attrName="isRead", label="是否已读 0否 1是"),
		@Column(name="user_id", attrName="userId", label="用户ID"),
		@Column(name="up_read", attrName="upRead", label="是否已读 0否 1是"),
		@Column(name="type", attrName="type", label="类型"),
	}, orderBy="a.id DESC"
)
public class PtPush extends DataEntity<PtPush> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 标题
	private Date createTime;		// create_time
	private String content;		// 内容
	private String url;		// 跳转地址
	private String isRead;		// 是否已读 0否 1是
	private String userId;		// 用户ID
	private String upRead;		// 是否已读 0否 1是
	private String type;		// 类型

	private Map<String, Object> payload;

	public Map<String, Object> getPayload() {
		return payload;
	}

	public void setPayload(Map<String, Object> payload) {
		this.payload = payload;
	}

	public PtPush() {
		this(null);
	}
	
	public PtPush(String id){
		super(id);
	}
	
	@Size(min=0, max=255, message="标题长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Size(min=0, max=255, message="内容长度不能超过 255 个字符")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Size(min=0, max=255, message="跳转地址长度不能超过 255 个字符")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	@Size(min=0, max=2, message="是否已读 0否 1是长度不能超过 2 个字符")
	public String getIsRead() {
		return isRead;
	}

	public void setIsRead(String isRead) {
		this.isRead = isRead;
	}
	
	@Size(min=0, max=50, message="用户ID长度不能超过 50 个字符")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@Size(min=0, max=2, message="是否已读 0否 1是长度不能超过 2 个字符")
	public String getUpRead() {
		return upRead;
	}

	public void setUpRead(String upRead) {
		this.upRead = upRead;
	}
	
	@Size(min=0, max=50, message="类型长度不能超过 50 个字符")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
}